home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / E1.ASM < prev    next >
Assembly Source File  |  1991-08-19  |  2KB  |  106 lines

  1. code    segment
  2.         assume  cs:code, ds:code
  3.         org     100h
  4.  
  5. asc2    equ     asc + 128
  6.  
  7. prog:
  8.  
  9.         mov     ax,cs
  10.         add     ax,1000h
  11.         mov     es,ax
  12.         mov     si,0100h
  13.         mov     di,si
  14.         mov     cx,5000h
  15.         rep     movsb
  16.         mov     word ptr [next+2],es
  17.         jmp     dword ptr [next]
  18.  
  19. next    db      1dh,1,0,0
  20.  
  21. part2:
  22.         push    ds
  23.         pop     es
  24.         push    cs
  25.         pop     ds
  26.  
  27.         mov     di,offset asc + 128
  28.         sub     bx,bx
  29. k10:    mov     [bx][di],bl
  30.         inc     bl
  31.         jnz     k10
  32.         mov     si,offset asc
  33. k20:    mov     bl,[si]
  34.         mov     byte ptr [bx][di],0
  35.         inc     si
  36.         cmp     si,di
  37.         jne     k20
  38.         dec     di
  39.         mov     cx,128
  40. k30:    inc     di
  41.         cmp     byte ptr [di],0
  42.         je      k30
  43.         mov     al,[di]
  44.         mov     [si],al
  45.         inc     si
  46.         loop    k30
  47.  
  48.         mov     bx,50ffh
  49.         mov     di,bx
  50.         mov     cl,0
  51. l10:    mov     ah,[di]
  52.         mov     al,[di-1]
  53.         mov     si,ax
  54.         sub     ax,ax
  55.         mov     dl,6
  56.         shl     si,cl
  57.         mov     ch,cl
  58.         mov     cl,12
  59.         shl     si,1
  60.         jnc     l20
  61.         mov     al,64
  62.         dec     cx
  63.         dec     cx
  64.         inc     dx
  65.         inc     dx
  66.         shl     si,1
  67.         jnc     l30
  68.         shl     ax,1
  69.         dec     cx
  70.         inc     dx
  71.         jmp     short l30
  72. l20:    shl     si,1
  73.         jnc     l30
  74.         inc     dx
  75.         mov     al,16
  76.         shl     si,1
  77.         jnc     l30
  78.         shl     ax,1
  79.         dec     cx
  80.         inc     dx
  81. l30:    shr     si,cl
  82.         add     si,ax
  83.         mov     al,asc[si]
  84.         mov     es:[bx],al
  85.         mov     cl,dl
  86.         add     cl,ch
  87. l40:    cmp     cl,8
  88.         jc      l50
  89.         sub     cl,8
  90.         dec     di
  91.         jmp     short l40
  92. l50:    dec     bx
  93.         cmp     bx,00ffh
  94.         jne     l10
  95.  
  96.         mov     [next],0
  97.         mov     word ptr [next+2],es
  98.         jmp     dword ptr [next]
  99.  
  100. asc     db      ?
  101.  
  102. last    label   byte
  103. code    ends
  104.         end     prog
  105.  
  106.